home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / Entwickler / Mac-OS / oxygen / samples / docbook / xsl / html / admon.xsl next >
Encoding:
Extensible Markup Language  |  2002-09-09  |  3.8 KB  |  102 lines  |  [□□□□/□□□□]

  1.     admon.xsl ¢π¢tÚπ¢tÚÅÅ·Ì<?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 version='1.0'>
  4.  
  5. <!-- ********************************************************************
  6.      $Id: admon.xsl,v 1.1 2002/05/29 09:55:49 dan Exp $
  7.      ********************************************************************
  8.  
  9.      This file is part of the XSL DocBook Stylesheet distribution.
  10.      See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  11.      and other information.
  12.  
  13.      ******************************************************************** -->
  14.  
  15. <xsl:template name="admon.graphic.width">
  16.   <xsl:param name="node" select="."/>
  17.   <xsl:text>25</xsl:text>
  18. </xsl:template>
  19.  
  20. <xsl:template match="note|important|warning|caution|tip">
  21.   <xsl:choose>
  22.     <xsl:when test="$admon.graphics != 0">
  23.       <xsl:call-template name="graphical.admonition"/>
  24.     </xsl:when>
  25.     <xsl:otherwise>
  26.       <xsl:call-template name="nongraphical.admonition"/>
  27.     </xsl:otherwise>
  28.   </xsl:choose>
  29. </xsl:template>
  30.  
  31. <xsl:template name="admon.graphic">
  32.   <xsl:param name="node" select="."/>
  33.   <xsl:value-of select="$admon.graphics.path"/>
  34.   <xsl:choose>
  35.     <xsl:when test="name($node)='note'">note</xsl:when>
  36.     <xsl:when test="name($node)='warning'">warning</xsl:when>
  37.     <xsl:when test="name($node)='caution'">caution</xsl:when>
  38.     <xsl:when test="name($node)='tip'">tip</xsl:when>
  39.     <xsl:when test="name($node)='important'">important</xsl:when>
  40.     <xsl:otherwise>note</xsl:otherwise>
  41.   </xsl:choose>
  42.   <xsl:value-of select="$admon.graphics.extension"/>
  43. </xsl:template>
  44.  
  45. <xsl:template name="graphical.admonition">
  46.   <div class="{name(.)}">
  47.   <xsl:if test="$admon.style != ''">
  48.     <xsl:attribute name="style">
  49.       <xsl:value-of select="$admon.style"/>
  50.     </xsl:attribute>
  51.   </xsl:if>
  52.   <table border="0">
  53.     <tr>
  54.       <td rowspan="2" align="center" valign="top">
  55.         <xsl:attribute name="width">
  56.           <xsl:call-template name="admon.graphic.width"/>
  57.         </xsl:attribute>
  58.         <img>
  59.           <xsl:attribute name="src">
  60.             <xsl:call-template name="admon.graphic"/>
  61.           </xsl:attribute>
  62.         </img>
  63.       </td>
  64.       <th>
  65.         <xsl:call-template name="anchor"/>
  66.         <xsl:apply-templates select="." mode="object.title.markup"/>
  67.       </th>
  68.     </tr>
  69.     <tr>
  70.       <td colspan="2" align="left" valign="top">
  71.         <xsl:apply-templates/>
  72.       </td>
  73.     </tr>
  74.   </table>
  75.   </div>
  76. </xsl:template>
  77.  
  78. <xsl:template name="nongraphical.admonition">
  79.   <div class="{name(.)}">
  80.     <xsl:if test="$admon.style">
  81.       <xsl:attribute name="style">
  82.         <xsl:value-of select="$admon.style"/>
  83.       </xsl:attribute>
  84.     </xsl:if>
  85.  
  86.     <h3 class="title">
  87.       <xsl:call-template name="anchor"/>
  88.       <xsl:apply-templates select="." mode="object.title.markup"/>
  89.     </h3>
  90.  
  91.     <xsl:apply-templates/>
  92.   </div>
  93. </xsl:template>
  94.  
  95. <xsl:template match="note/title"></xsl:template>
  96. <xsl:template match="important/title"></xsl:template>
  97. <xsl:template match="warning/title"></xsl:template>
  98. <xsl:template match="caution/title"></xsl:template>
  99. <xsl:template match="tip/title"></xsl:template>
  100.  
  101. </xsl:stylesheet>
  102. This resource fork intentionally left blank   ˇˇ